package com.company.java.basic.the_Pay_Factory;

public class PayFactory {
    public Pay producePay(String the_pay){
        Pay pay = null;
        if (the_pay == "WeiXin"){
            pay = new WeiXin();
        }else if (the_pay == "ZhiFuBao") {
            pay = new ZhiFuoBao();
        }else if (the_pay == "XianJin"){
            pay = new XianJin();
        }else if (the_pay == "XinYongCard"){
            pay = new XinYongCard();
        }else {
            System.out.println("不支持该支付方式");
        }
        return pay;
    }
}
